package org.jeecg.modules.activiti.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.activiti.entity.SignTable;

import java.util.List;

public interface SignTableMapper extends BaseMapper<SignTable> {

    @Delete("delete from signtable where proceid= #{proceid} ")
    public int deleteByProceid(@Param("proceid") String proceid);

    @Select("select * from signtable where proceid=#{proceid} and task_def_key=#{taskDefKey}")
    public List<SignTable> getDataListByBackTaskDef(@Param("proceid") String proceid,@Param("taskDefKey") String taskDefKey);

    @Delete("delete from signtable where proceid=#{proceid} and DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%s')>=#{startTime}")
    public int deleteForBackTask(@Param("proceid") String proceid,@Param("startTime") String startTime);

    @Select("select * from signtable where proceid=#{proceid}")
    public List<SignTable> getDataListByProceId(@Param("proceid") String proceid);
}
